package com.sailfish.springbootdemo.controller.db7;

import com.alibaba.fastjson.JSONObject;
import com.sailfish.springbootdemo.pojo.Result;
import com.sailfish.springbootdemo.pojo.db7.TbDataDictionary;
import com.sailfish.springbootdemo.service.db7.TbDataDictionaryService;
import com.sailfish.springbootdemo.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/TbDataDictionary")
public class TbDataDictionaryController {

    @Autowired
    private TbDataDictionaryService tbDataDictionaryService;

    @PostMapping("/getDataDictionaryList")
    public Result getDataDictionaryList(@RequestBody String data) {

        System.out.println(11111);
        return tbDataDictionaryService.getDataDictionaryList(data);

        //return ResultUtil.success(getDataDictionList);
    }

    @PostMapping("/getDataDictionaryByParamKey")
    public Result getDataDictionaryByParamKey(@RequestBody String data) {

        return tbDataDictionaryService.getDataDictionaryByParamKey(data);

        //return ResultUtil.success(getDataDictionList);
    }


    @PostMapping("/insertTbDataDictionary")
    public Result insertTbDataDictionary(@RequestBody String data) {

        return tbDataDictionaryService.insertTbDataDictionary(data);

        //return ResultUtil.success(getDataDictionList);
    }

    @PostMapping("/updateTbDataDictionary")
    public Result updateTbDataDictionary(@RequestBody String data) {
        return tbDataDictionaryService.updateDataDictionary(data);
    }

    @PostMapping("/deleteTbDataDictionary")
    public Result deleteTbDataDictionary(@RequestBody String data) {
        return tbDataDictionaryService.deleteDataDictionary(data);
    }

    @PostMapping("/insertTbDataDictionaryBatch")
    public Result insertTbDataDictionaryBatch(@RequestBody String data) {

        return tbDataDictionaryService.insertTbDataDictionaryBatch(data);

        //return ResultUtil.success(getDataDictionList);
    }

    @PostMapping("/getDataDictionarySelectLevel")
    public Result getDataDictionarySelectLevel(@RequestBody String data) {

        return tbDataDictionaryService.getDataDictionarySelectLevel(data);

        //return ResultUtil.success(getDataDictionList);
    }



}
